﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using Microsoft.Practices.EnterpriseLibrary.Common;
using System.Configuration;
using Insifo.BE.Gen;

namespace Insifo.DL.Gen
{
    public class DLCliente
    {
        #region  Members

        /// <summary>
        /// Método obtiene las Companias
        /// </summary>
        /// <returns>Devuelve un DataSet</returns>
        public DataSet Listar(BECliente pbe)
        {
            DataSet ds = new DataSet();
            SqlDatabase sqlDB = new SqlDatabase(CadenaConexion.Obtener());
            DbCommand dbCmd = sqlDB.GetStoredProcCommand("uSP_INSIFO_GEN_Cliente_Listar");
            try
            {
                dbCmd.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings["CommandTimeout"]);
                ds = sqlDB.ExecuteDataSet(dbCmd);
            }
            catch (Exception e)
            {
                throw e;
            }

            finally
            {                
                dbCmd.Dispose();
            }
            return ds;
        }

       
        #endregion  Members
    }
}
